package com.quartz.tasks.web.controller;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@RestController
public class TestController {


    @RequestMapping("/hello")
    public Object hello(@RequestBody Map<String,Object> param) throws InterruptedException {
        System.out.println("hello 收到请求--->" +  param.toString());
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Map<String,Object> map = new HashMap<>();
        map.put("date",sdf.format(new Date()));
        map.put("msg","hello word");
        //Thread.sleep(1000*60);
        return map;
    }

    @RequestMapping("/hello2")
    public Object hello2(@RequestBody Map<String,Object> param) throws InterruptedException {
        System.out.println("hello2 收到请求--->" +  param.toString());
        Map<String,Object> map = new HashMap<>();
        map.put("msg","hello2 word");
        System.out.println("h");
        //Thread.sleep(1000*60);
        return map;
    }
}
